package cn.bdqn.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;

import cn.bdqn.entity.Address;
import cn.bdqn.service.AddressService;

@Controller
@RequestMapping("address")
public class AddressController {
	@Autowired
	private AddressService service;
	@ResponseBody
	@RequestMapping(value="queryAddress",produces= {"application/json;charset=UTF-8"})
	public String queryaddress(Integer pid) {
		List<Address> list=service.queryAllAddress(pid);
		return JSON.toJSONString(list);
	}
}
